package com.sgam.mf.domain.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityResult;
import javax.persistence.FetchType;
import javax.persistence.FieldResult;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedNativeQuery;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.SqlResultSetMapping;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.springframework.format.annotation.DateTimeFormat;

import com.sgam.mf.domain.ref.RefBranch;
import com.sgam.mf.domain.ref.RefCompany;
import com.sgam.mf.domain.ref.RefDomains;
import com.sgam.mf.domain.ref.RefGift;
import com.sgam.mf.domain.ref.RefServices;
import com.sgam.mf.domain.ref.RefStatus;
import com.sgam.mf.domain.sec.SecUser;
import com.sgam.mf.domain.stock.StockSold;
import com.sgam.mf.helper.RomanianNumberToWords;
import com.sgam.utils.CustomDateDeserializer;
import com.sgam.utils.CustomDateSerializer;
import com.sgam.utils.CustomDateTimeSerializer;

//@SqlResultSetMapping (name="ContractsList",  
//entities=@EntityResult(entityClass=ContractsList.class, 
//fields={ @FieldResult(name="id", 			column="id"),
//		 @FieldResult(name="contractNo", 	column="contract_No"),
//		 @FieldResult(name="appRegDate", 	column="app_Reg_Date"),
//		 @FieldResult(name="refStatusFk", 	column="ref_status_fk"),
//		 @FieldResult(name="refStatusDesc", column="ref_status_desc"),
//		 @FieldResult(name="refDomainsFk", 	column="ref_domains_fk"),
//		 @FieldResult(name="refDomainsDesc", 	column="ref_domains_desc"),
//		 @FieldResult(name="refServicesFk", 	column="ref_services_fk"),
//		 @FieldResult(name="refServicesDesc", 	column="ref_services_desc"),
//
//		 @FieldResult(name="applFiscCode", 		column="appl_Fisc_Code"),
//		 @FieldResult(name="applPerson", 		column="appl_Person"),
//		 @FieldResult(name="creditAmount", 		column="credit_Amount"),
//		 @FieldResult(name="activityTypeDesc", 	column="activity_Type_Desc"),
//		 @FieldResult(name="projTypeDesc", 		column="proj_Type_Desc"),
//		 @FieldResult(name="optionsDesc", 		column="options_Desc"),
//
//		 @FieldResult(name="contractDate", 		column="contract_Date"),
//		 @FieldResult(name="contractFiscCode", 	column="contract_Fisc_Code"),
//		 @FieldResult(name="contractPerson", 	column="contract_Person"),
//		 @FieldResult(name="amount", 			column="amount"),
//		 @FieldResult(name="prepayment", 		column="prepayment"),
//		 @FieldResult(name="dbt", 				column="dbt"),
//		 @FieldResult(name="paymentOptionsDesc", 	column="payment_Options_Desc")
//
//		 
//			}))
//@NamedNativeQuery(
//resultSetMapping = "ContractsList",
//name = "shortList",
//query = "select  " +
//		"app_reg_date, " +
//		"id, " +
//		"contract_no, " +
//		"ref_status_fk, " +
//		"ref_status_desc, " +
//		"ref_domains_fk, " +
//		"ref_domains_desc, " +
//		"ref_services_fk, " +
//		"ref_services_desc, " +
//		"appl_fisc_code, " +
//		"appl_person, " +
//		"credit_amount, " +
//		"activity_type_desc, " +
//		"proj_type_desc, " +
//		"options_desc, " +
//		"contract_date, " +
//		"contract_fisc_code, " +
//		"contract_person, " +
//		"amount, " +
//		"prepayment, " +
//		"dbt, " +
//		"payment_options_desc " +
//		"from  v_contracts"
//)

@Entity
@Table(name = "V_CONTRACTS")
public class ContractsList{


	@Id
	@Column(name = "id")
	private Integer id;
	
	@JsonSerialize(using = CustomDateSerializer.class)
	@JsonDeserialize(using = CustomDateDeserializer.class)
	@DateTimeFormat(pattern="dd.MM.yyyy")
	@Column(name = "app_Reg_Date") 
	private Date appRegDate;
	
	@Column(name = "ref_status_fk")
	private Integer refStatusFk;
	
	@Column(name = "ref_status_desc")
	private String refStatusDesc;
	
	@Column(name = "ref_domains_fk")
	private Integer refDomainsFk;
	
	@Column(name = "ref_domains_desc")
	private String refDomainsDesc;
	
	@Column(name = "ref_services_fk")
	private Integer refServicesFk;
	
	@Column(name = "ref_services_desc")
	private String refServicesDesc;
	
	
	@Column(name = "appl_Fisc_Code")
	private String applFiscCode;
	
	@Column(name = "appl_Person")
	private String applPerson;
	
	@Column(name = "credit_Amount")
	private String creditAmount;
	
//	@Column(name = "activity_Type_Desc")
//	private String activityTypeDesc;
	
	@Column(name = "proj_Type_Desc")
	private String projTypeDesc;
	
	@Column(name = "options_Desc")
	private String optionsDesc;

	 
	 @Column(name = "contract_No")
		private String contractNo;
	 
	 @JsonSerialize(using = CustomDateSerializer.class)
	 @JsonDeserialize(using = CustomDateDeserializer.class)
	 @DateTimeFormat(pattern="dd.MM.yyyy")
	 @Column(name = "contract_Date")
		private Date contractDate;
	 
	 @Column(name = "contract_Fisc_Code")
		private String contractFiscCode;
	 
	 @Column(name = "contract_Person")
		private String contractPerson;
	 
	 @Column(name = "amount")
		private Integer amount;
	 
	 @Column(name = "prepayment")
		private Integer prepayment;
	 
	 @Column(name = "dbt")
		private Integer dbt;
	 
	 @Column(name = "payment_Options_Desc")
		private String paymentOptionsDesc;

	 @Column(name = "last_comment_user_fk")
		private Integer lastComm;

	 @Column(name = "ref_bank_desc")
		private String refBankDesc;
	 
	 @Column(name = "respons_consultant_fk")
		private Integer respons_consultant_fk;
	 
	 @Column(name = "respons_personal_fk")
		private Integer respons_personal_fk;
	 
	 @Column(name = "respons_personal2_fk")
		private Integer respons_personal2_fk;
	 
	 @Column(name = "destinatia")
		private String destinatia;
	 
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Date getAppRegDate() {
		return appRegDate;
	}

	public void setAppRegDate(Date appRegDate) {
		this.appRegDate = appRegDate;
	}

	public Integer getRefStatusFk() {
		return refStatusFk;
	}

	public void setRefStatusFk(Integer refStatusFk) {
		this.refStatusFk = refStatusFk;
	}

	public String getRefStatusDesc() {
		return refStatusDesc;
	}

	public void setRefStatusDesc(String refStatusDesc) {
		this.refStatusDesc = refStatusDesc;
	}

	public Integer getRefDomainsFk() {
		return refDomainsFk;
	}

	public void setRefDomainsFk(Integer refDomainsFk) {
		this.refDomainsFk = refDomainsFk;
	}

	public String getRefDomainsDesc() {
		return refDomainsDesc;
	}

	public void setRefDomainsDesc(String refDomainsDesc) {
		this.refDomainsDesc = refDomainsDesc;
	}

	public Integer getRefServicesFk() {
		return refServicesFk;
	}

	public void setRefServicesFk(Integer refServicesFk) {
		this.refServicesFk = refServicesFk;
	}

	public String getRefServicesDesc() {
		return refServicesDesc;
	}

	public void setRefServicesDesc(String refServicesDesc) {
		this.refServicesDesc = refServicesDesc;
	}

	public String getApplFiscCode() {
		return applFiscCode;
	}

	public void setApplFiscCode(String applFiscCode) {
		this.applFiscCode = applFiscCode;
	}

	public String getApplPerson() {
		return applPerson;
	}

	public void setApplPerson(String applPerson) {
		this.applPerson = applPerson;
	}

	public String getCreditAmount() {
		return creditAmount;
	}

	public void setCreditAmount(String creditAmount) {
		this.creditAmount = creditAmount;
	}

//	public String getActivityTypeDesc() {
//		return activityTypeDesc;
//	}
//
//	public void setActivityTypeDesc(String activityTypeDesc) {
//		this.activityTypeDesc = activityTypeDesc;
//	}

	public String getProjTypeDesc() {
		return projTypeDesc;
	}

	public void setProjTypeDesc(String projTypeDesc) {
		this.projTypeDesc = projTypeDesc;
	}

	public String getOptionsDesc() {
		return optionsDesc;
	}

	public void setOptionsDesc(String optionsDesc) {
		this.optionsDesc = optionsDesc;
	}

	public String getContractNo() {
		return contractNo;
	}

	public void setContractNo(String contractNo) {
		this.contractNo = contractNo;
	}

	public Date getContractDate() {
		return contractDate;
	}

	public void setContractDate(Date contractDate) {
		this.contractDate = contractDate;
	}

	public String getContractFiscCode() {
		return contractFiscCode;
	}

	public void setContractFiscCode(String contractFiscCode) {
		this.contractFiscCode = contractFiscCode;
	}

	public String getContractPerson() {
		return contractPerson;
	}

	public void setContractPerson(String contractPerson) {
		this.contractPerson = contractPerson;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public Integer getPrepayment() {
		return prepayment;
	}

	public void setPrepayment(Integer prepayment) {
		this.prepayment = prepayment;
	}

	public Integer getDbt() {
		return dbt;
	}

	public void setDbt(Integer dbt) {
		this.dbt = dbt;
	}

	public String getPaymentOptionsDesc() {
		return paymentOptionsDesc;
	}

	public void setPaymentOptionsDesc(String paymentOptionsDesc) {
		this.paymentOptionsDesc = paymentOptionsDesc;
	}

	public Integer getLastComm() {
		return lastComm;
	}

	public void setLastComm(Integer lastComm) {
		this.lastComm = lastComm;
	}

	public String getRefBankDesc() {
		return refBankDesc;
	}

	public void setRefBankDesc(String refBankDesc) {
		this.refBankDesc = refBankDesc;
	}

	public Integer getRespons_consultant_fk() {
		return respons_consultant_fk;
	}

	public void setRespons_consultant_fk(Integer respons_consultant_fk) {
		this.respons_consultant_fk = respons_consultant_fk;
	}

	public Integer getRespons_personal_fk() {
		return respons_personal_fk;
	}

	public void setRespons_personal_fk(Integer respons_personal_fk) {
		this.respons_personal_fk = respons_personal_fk;
	}

	public Integer getRespons_personal2_fk() {
		return respons_personal2_fk;
	}

	public void setRespons_personal2_fk(Integer respons_personal2_fk) {
		this.respons_personal2_fk = respons_personal2_fk;
	}

	public String getDestinatia() {
		return destinatia;
	}

	public void setDestinatia(String destinatia) {
		this.destinatia = destinatia;
	}


	
	
}


 

